{% extends '../common/common.html' %}
{% block main %}
<div class="admin-box">
    <div class="crumbs-nav">
        <a href="/admin">管理首页</a> &gt; <a href="content.html">内容管理</a> &gt; <span>修改内容</span>
    </div>
    <h2 class="admin-title">添加分类</h2>

    <div class="main-form" id="edit_centent">
        <div class="form-li">
            <label for="category">所属分类：</label>
            <div class="form-box">
                <select id="category" name="category">
                    {% for categorydata in categorydata %}
                    {% if contentedit.categoryid == categorydata.id %}
                    <option value="{{ categorydata.id }}" selected>{{ categorydata.name }}</option>
                    {% else %}
                    <option value="{{ categorydata.id }}">{{ categorydata.name }}</option>
                    {% endif %}
                    {% endfor %}
                </select>
            </div>
        </div>
        <div class="form-li">
            <label for="title">标题：</label>
            <div class="form-box">
                <input type="text" placeholder="请输入标题" id="title" name="title" value="{{ contentedit.title }}">
            </div>
        </div>
        <div class="form-li">
            <label for="abstract">简介：</label>
            <div class="form-box">
                <textarea placeholder="请输入简介" id="abstract" name="abstract">{{ contentedit.abstract }}</textarea>
            </div>
        </div>
        <div class="form-li">
            <label>内容：</label>
            <div class="form-box">
                <script id="editor" type="text/plain" style="width:80%;height:500px;">{% autoescape %}{{ contentedit.content }}{% endautoescape %}</script>
            </div>
        </div>
        <div class="form-li">
            <label></label>
            <div class="form-box">
                <input type="hidden" value="{{ contentedit.id }}" name="contentid">
                <input type="submit" value="提交" id="content_edit_sub">
            </div>
        </div>

    </div>
</div>
<script>
    var ue = UE.getEditor('editor');
</script>
{% endblock %}